﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<hercules.Models.CompraModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Compra
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Compra</h2>

<p>
    <%: Html.ActionLink("Inserir Nova Compra", "Create") %>
</p>
<table>
    <tr>
        <th>
            Funcionário
        </th>
        <th>
            Fornecedor
        </th>
        <th>
            Data Emissão
        </th>
        <th>
            Base Calculo ST
        </th>
        <th>
            Valor Nota
        </th>
        <th>
            Base Calculo Icms
        </th>
        <th>
            Valor Icms
        </th>
        <th>
            Valor ST
        </th>
        <th>
            Status Compra
        </th>
        <th></th>
    </tr>

<% foreach (var item in Model) { %>
    <tr>
        <td>
            <%: Html.DisplayFor(modelItem => item.Pessoa1.cpf) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Pessoa.cpf) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.dataEmissao) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.baseCalculoST) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.valorNota) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.baseCalculoIcms) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.valorIcms) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.valorST) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.statusCompra) %>
        </td>
        <td>
            <%: Html.ActionLink("Edit", "Edit", new { id=item.numeroNota }) %> |
            <%: Html.ActionLink("Details", "Details", new { id=item.numeroNota }) %> |
            <%: Html.ActionLink("Deletar", "Delete", new { id=item.numeroNota }) %>
            <%: Html.ActionLink("Itens", "SearchIndex", "ProdutoVenda", new { numeroNota=item.NumeroNota },null)%>
        </td>
    </tr>
<% } %>

</table>

</asp:Content>
